<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>学生管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function showGuideModel(id,stuName,curJifen){
			$("#ddf").val(id);
			$("#stuName").val(stuName);
			$("#stuName").attr("disabled",true);
			$("#curJifenAmount").val(curJifen);
			$("#curJifenAmount").attr("disabled",true);
			$("#mymodal").modal('show');
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/student/bizStudent">学生列表</a></li>
		<shiro:hasPermission name="student:bizStudent:edit"><li><a href="${ctx}/student/bizStudent/form">学生添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="bizStudent" action="${ctx}/student/bizStudent" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>学生姓名：</label>
				<form:input path="stuName" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>手机号：</label>
				<form:input path="telNo" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>学校：</label>
				<form:select path="schId" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('sch')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>学生ID</th>
				<th>学生姓名</th>
				<th>可用积分</th>
				<th>手机号</th>
				<th>性别</th>
				<th>学科ID</th>
				<th>学科名称</th>
				<th>民族</th>
				<th>出生日期</th>
				<th>学校名称</th>
				<th>更新时间</th>
				<shiro:hasPermission name="student:bizStudent:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="bizStudent">
			<tr>
				<td><a href="${ctx}/student/bizStudent/form?opt=detail&id=${bizStudent.id}">
					${bizStudent.id}
				</a></td>
				<td>
					${bizStudent.stuName}
				</td>
				<td>
					${bizStudent.jifenAmount}
				</td>
				<td>
					${bizStudent.telNo}
				</td>
				<td>
					${fns:getDictLabel(bizStudent.gender, 'gender', '')}
				</td>
				<td>
					${bizStudent.subjectId}
				</td>
				<td>
					${bizStudent.subjectName}
				</td>
				<td>
					${fns:getDictLabel(bizStudent.stuNation, 'nation', '')}
				</td>
				<td>
					<fmt:formatDate value="${bizStudent.birthday}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${bizStudent.schName}
				</td>
				<td>
					<fmt:formatDate value="${bizStudent.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<shiro:hasPermission name="student:bizStudent:edit"><td>
					<a href="#"  data-toggle="modal" onclick="javascript:showGuideModel('${bizStudent.id}','${bizStudent.stuName}','${bizStudent.jifenAmount}')" data-target="#myModal">积分发放</button>
    				<a href="${ctx}/student/bizStudent/form?id=${bizStudent.id}">修改</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
	
	<!-- 模态框（Modal） -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width:1200px;margin-left: -700px">
		    <div class="modal-dialog">
		        <div class="modal-content">
		            <div class="modal-header">
		                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		                <h4 class="modal-title" id="myModalLabel">积分发放</h4>
		            </div>
		            <div class="modal-body">
		            	<form id="inputFormF"  action="${ctx}/student/bizStudent/reword" method="post" class="form-horizontal">
							<input type="hidden" name="id" id="ddf"/>
							<div class="control-group">
								<label class="control-label">学生姓名：</label>
								<div class="controls">
									<input type="text" id="stuName"  maxlength="64" class="input-xlarge "/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">积分数：</label>
								<div class="controls">
									<input type="text" id="curJifenAmount" htmlEscape="false" maxlength="64" class="input-xlarge "/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">发放积分数：</label>
								<div class="controls">
									<input type="text" name="jifenAmount" htmlEscape="false" maxlength="64" class="input-xlarge "/>
								</div>
							</div>
							<div class="form-actions">
								<button type="button" class="btn btn-default" data-dismiss="modal" id="guideCloseBut">关闭</button>
								<button type="button" class="btn btn-primary">提交更改</button>
							</div>
						</form>
		            </div>
		        </div><!-- /.modal-content -->
		    </div><!-- /.modal -->
	  </div>
</body>
</html>